#!/usr/bin/env python
# -*- coding: utf8 -*-

TEMPLATE_STYLE = """
/****************** global ********************/
*{
    color:@font_color@; 
    font-family:\"@font_family@\"; 
    font-size:@font_size@px; 
    border:none;
    outline:0px;
    background-color:@background_color@;
    border-color:@border_color@;
    
}

/****************** font ********************/
*[font_weight="bold"]{
    font-weight: bold;
}
/****************** font-size ********************/
*[font_size="01"]{
    font-size:@font_size_01@px;
}
*[font_size="02"]{
    font-size:@font_size_02@px;
}
*[font_size="03"]{
    font-size:@font_size_03@px;
}
*[font_size="04"]{
    font-size:@font_size_04@px;
}
*[font_size="05"]{
    font-size:@font_size_05@px;
}
*[font_size="06"]{
    font-size:@font_size_06@px;
}
*[font_size="07"]{
    font-size:@font_size_07@px;
}
*[font_size="08"]{
    font-size:@font_size_08@px;
}
*[font_size="09"]{
    font-size:@font_size_09@px;
}
*[font_size="10"]{
    font-size:@font_size_10@px;
}
/****************** font-color ********************/
*[font_color="01"]{
    color:@font_color_01@;
}
*[font_color="02"]{
    color:@font_color_02@;
}
*[font_color="03"]{
    color:@font_color_03@;
}
*[font_color="04"]{
    color:@font_color_04@;
}
*[font_color="05"]{
    color:@font_color_05@;
}
*[font_color="06"]{
    color:@font_color_06@;
}
*[font_color="07"]{
    color:@font_color_07@;
}
*[font_color="08"]{
    color:@font_color_08@;
}
*[font_color="09"]{
    color:@font_color_09@;
}
*[font_color="10"]{
    
    color:@font_color_10@;
}

/****************** background-color ********************/
*[background_color="01"]{
    background-color:@background_color_01@;
}
*[background_color="02"]{
    background-color:@background_color_02@;
}
*[background_color="03"]{
    background-color:@background_color_03@;
}
*[background_color="04"]{
    background-color:@background_color_04@;
}
*[background_color="05"]{
    background-color:@background_color_05@;
}
*[background_color="06"]{
    background-color:@background_color_06@;
}
*[background_color="07"]{
    background-color:@background_color_07@;
}
*[background_color="08"]{
    background-color:@background_color_08@;
}
*[background_color="09"]{
    background-color:@background_color_09@;
}
*[background_color="10"]{
    background-color:@background_color_10@;
}




QLabel{
    background-color:rgba(0,0,0,0);
    }
/****************** PushButton ********************/
QPushButton{
    background-color:@PushButton@;
}
QPushButton::hover{
    background-color:@PushButton_hover@;
}
QPushButton::disabled{
    background-color:@PushButton_disabled@;
}
/*
QPushButton::menu-indicator:hover,
QPushButton::menu-indicator:pressed,
QPushButton::menu-indicator:open,
*/
QPushButton::menu-indicator{
    image:url(@PushButton_indicator@);
    subcontrol-position: right center;
    subcontrol-origin: padding;
    width:@PushButton_indicator_size@px;
    height:@PushButton_indicator_size@px;
    padding-left:6px;
    }
QPushButton[menu="#"]::menu-indicator{
    image:url(@PushButton_01_indicator@);
    width:@PushButton_01_indicator_size@px;
    height:@PushButton_01_indicator_size@px;
}
QPushButton[menu="##"]::menu-indicator{
    image:url(@PushButton_02_indicator@);
    width:@PushButton_02_indicator_size@px;
    height:@PushButton_02_indicator_size@px;
}
QPushButton[menu="###"]::menu-indicator{
    image:url(@PushButton_03_indicator@);
    width:@PushButton_03_indicator_size@px;
    height:@PushButton_03_indicator_size@px;
}
QToolButton{
    background-color:@ToolButton@;
}
QToolButton::hover{
    background-color:@ToolButton_hover@;
}
QToolButton::disabled{
    background-color:@ToolButton_disabled@;
}
QToolButton::menu-indicator:hover,
QToolButton::menu-indicator:pressed,
QToolButton::menu-indicator:open,
QToolButton::menu-indicator{
    image:url(@ToolButton_indicator@);
    subcontrol-position: right center;
    subcontrol-origin: padding;
    width:16px;
    height:16px;

    }

/****************** LineEdit ********************/
QLineEdit{
    background-color:@LineEdit@;
    color:@font_color@;
}

/****************** QCheckBox ********************/
QCheckBox{
    background-color:@CheckBox@;
}
QCheckBox::indicator{
    image:url(@CheckBox_indicator@);
    width:14px;
    height:14px;
    }
QCheckBox::indicator::hover{
    image:url(@CheckBox_indicator_hover@);
    background-color:rgba(0,0,0,0);
    width:14px;
    height:14px;
    }
QCheckBox::indicator::checked{
    image:url(@CheckBox_indicator_checked@);
    width:14px;
    height:14px;
    }
QCheckBox::indicator::disabled{
    image:url(@CheckBox_indicator_disabled@);
    width:14px;
    height:14px;
    }

/****************** RadioButton ********************/
QRadioButton::indicator{
    image:url(@RadioButton_indicator@);
    }
QRadioButton::indicator::hover{
    image:url(@RadioButton_indicator_hover@);
    }
QRadioButton::indicator::checked{
    image:url(@RadioButton_indicator_checked@);
    }
QRadioButton::indicator::disabled{
    image:url(@RadioButton_indicator_disabled@);
    }

/****************** ComboBox ********************/
QComboBox{
    background:@ComboBox@;
    }
QComboBox:editable{
    background:@ComboBox_editable@;
    }
QComboBox:!editable{
    background:@ComboBox_not_editable@;
    }
QComboBox:editable:on{
    background:@ComboBox_editable_on@;
    }
QComboBox:!editable:on{
    background:@ComboBox_not_editable_on@;
    }
QComboBox:drop-down{
     image: url(@ComboBox_drop_down@);
     height:20px;
     width:20px;
    }
/****************** Menu ********************/
QMenu{
    border: 1px solid #484849;
    background:@Menu@;
    }
QMenu:item:disabled{
    color:@Menu_item_disabled_text@;
    background-color:@Menu_item_disabled@;
    }
QMenu:item:disabled:selected{
    background:@Menu_item_disabled_selected@;
    color:@Menu_item_disabled_selected_text@;
    }
QMenu:item:hover{
    background-color:@Menu_item_hover@;
}
QMenu:item:selected{
    background-color:@Menu_item_selected@;
    }
/****************** AbstractItemView ********************/
QAbstractItemView{
    background:@AbstractItemView@;
    selection-background-color:@AbstractItem_selected@;
}
QAbstractItemView::item{
    background-color:@AbstractItem@;
}
QAbstractItemView::item:selected{
    background-color:@AbstractItem_selected@;
}
QAbstractItemView::item:hover{
    background-color:@AbstractItem_hover@;
}
/****************** QScrollArea ********************/
QScrollArea{
    background:@content_bg_color@;
}

/****************** Splitter ********************/
QSplitter::handle{
    background:@border_color@;
    }

/****************** scroll bar ********************/

QScrollBar:vertical{
    background:@ScrollBar@;
    margin:0px,0px,0px,0px;
    width:@ScrollBar_padding@px;
    padding-bottom:@ScrollBar_padding@px;
    padding-top:@ScrollBar_padding@px;
    }
QScrollBar:horizontal{
    background:@ScrollBar@;
    margin:0px,0px,0px,0px;
    height:@ScrollBar_padding@px;
    padding-left:@ScrollBar_padding@px;
    padding-right:@ScrollBar_padding@px;
    }
QScrollBar::add-page:vertical,
QScrollBar::sub-page:vertical,
QScrollBar::add-page:horizontal,
QScrollBar::sub-page:horizontal{
    background:@ScrollBar@;
    }
QScrollBar::handle:vertical{

    background-color:@ScrollBar_handle@;
    min-height:@ScrollBar_padding@px;
    }

QScrollBar::handle:vertical:hover{
    background:@ScrollBar_handle_hover@;
    min-height:@ScrollBar_padding@px;
    }
QScrollBar::add-line:vertical{
    background:@ScrollBar@;
    subcontrol-position:bottom;
    height:@ScrollBar_padding@px;
    image:url(@ScrollBar_vertical_add_line@);
    }
QScrollBar::sub-line:vertical{
    background:@ScrollBar@;
    subcontrol-position:top;
    height:@ScrollBar_padding@px;
    image:url(@ScrollBar_vertical_sub_line@);
    }
QScrollBar::handle:horizontal{
    background:@ScrollBar_handle@;
    min-width:@ScrollBar_padding@px;
    
    }
QScrollBar::handle:horizontal:hover{
    background:@ScrollBar_handle_hover@;
    min-width:@ScrollBar_padding@px;
    }
QScrollBar::add-line:horizontal{
    background:@ScrollBar@;
    subcontrol-position:left;
    width:@ScrollBar_padding@px;
    image:url(@ScrollBar_horizontal_add_line@);
    }
QScrollBar::sub-line:horizontal{
    background:@ScrollBar@;
    subcontrol-position:right;
    width:@ScrollBar_padding@px;
    image:url(@ScrollBar_horizontal_sub_line@);
    }

/****************** tab ********************/
QTabBar{
    background-color:@TabBar@;
}
QTabBar::tab{
    background-color:@TabBar_tab@;
}
QTabBar::tab:hover{
    background-color:@TabBar_tab_hover@;
}
QTabBar::tab:selected{
    background-color:@TabBar_tab_selected@;
}
QTabWidget::pane{
    background-color:@TabWidget_pane@;
}

/****************** property ********************/
*[separator="H"]{
    background-color:rgba(0,0,0,0);
    border-top:1px solid @border_color@;
    height: 0px;
    max-height: 0px;
}

*[separator="V"]{
    background-color:rgba(0,0,0,0);
    border-left:1px solid @border_color@;
    width: 0px;
    max-width: 0px;
}
*[border="#1000"]{
    border:none;
    border-left:@border_size@ solid @border_color@;
}
*[border="#0100"]{
    border:none;
    border-top:@border_size@ solid @border_color@;
}
*[border="#0010"]{
    border:none;
    border-right:@border_size@ solid @border_color@;
}
*[border="#0001"]{
    border:none;
    border-bottom:@border_size@ solid @border_color@;
}
*[border="#1100"]{
    border:none;
    border-left:@border_size@ solid @border_color@;
    border-top:@border_size@ solid @border_color@;
}
*[border="#1010"]{
    border:none;
    border-left:@border_size@ solid @border_color@;
    border-right:@border_size@ solid @border_color@;
}
*[border="#1001"]{
    border:none;
    border-left:@border_size@ solid @border_color@;
    border-bottom:@border_size@ solid @border_color@;
}
*[border="#0110"]{
    border:none;
    border-top:@border_size@ solid @border_color@;
    border-right:@border_size@ solid @border_color@;
}
*[border="#0101"]{
    border:none;
    border-top:@border_size@ solid @border_color@;
    border-bottom:@border_size@ solid @border_color@;
}
*[border="#0011"]{
    border:none;
    border-right:@border_size@ solid @border_color@;
    border-bottom:@border_size@ solid @border_color@;
}
*[border="#1110"]{
    border:none;
    border-left:@border_size@ solid @border_color@;
    border-top:@border_size@ solid @border_color@;
    border-right:@border_size@ solid @border_color@;
}
*[border="#1101"]{
    border:none;
    border-left:@border_size@ solid @border_color@;
    border-top:@border_size@ solid @border_color@;
    border-bottom:@border_size@ solid @border_color@;
}
*[border="#1011"]{
    border:none;
    border-left:@border_size@ solid @border_color@;
    border-right:@border_size@ solid @border_color@;
    border-bottom:@border_size@ solid @border_color@;
}
*[border="#0111"]{
    border:none;
    border-top:@border_size@ solid @border_color@;
    border-right:@border_size@ solid @border_color@;
    border-bottom:@border_size@ solid @border_color@;
}
*[border="#1111"]{
    border:none;
    border:@border_size@ solid @border_color@;
    /*
    border-left:@border_size@ solid @border_color@;
    border-top:@border_size@ solid @border_color@;
    border-right:@border_size@ solid @border_color@;
    border-bottom:@border_size@ solid @border_color@;
    */
}
*[border_radius="true"]{
    border-radius:@border_radius@px;
}
*[border_radius="#1111"]{
    border-radius:@border_radius@px;
}
*[border_radius="#1110"]{
    border-top-left-radius:@border_radius@px;
    border-top-right-radius:@border_radius@px;
    border-bottom-right-radius:@border_radius@px;
    border-bottom-left-radius:0px;
}
*[border_radius="#1101"]{
    border-top-left-radius:@border_radius@px;
    border-top-right-radius:@border_radius@px;
    border-bottom-right-radius:0px;
    border-bottom-left-radius:@border_radius@px;
}
*[border_radius="#1011"]{
    border-top-left-radius:@border_radius@px;
    border-top-right-radius:0px;
    border-bottom-right-radius:@border_radius@px;
    border-bottom-left-radius:@border_radius@px;
}
*[border_radius="#0111"]{
    border-top-left-radius:0px;
    border-top-right-radius:@border_radius@px;
    border-bottom-right-radius:@border_radius@px;
    border-bottom-left-radius:@border_radius@px;
}
*[border_radius="#1100"]{
    border-top-left-radius:@border_radius@px;
    border-top-right-radius:@border_radius@px;
    border-bottom-right-radius:0px;
    border-bottom-left-radius:0px;
    
}
*[border_radius="#1001"]{
    border-top-left-radius:@border_radius@px;
    border-top-right-radius:0px;
    border-bottom-right-radius:0px;
    border-bottom-left-radius:@border_radius@px;
}
*[border_radius="#0011"]{
    border-top-left-radius:0px;
    border-top-right-radius:0px;
    border-bottom-right-radius:@border_radius@px;
    border-bottom-left-radius:@border_radius@px;
}
*[border_radius="#1010"]{
    border-top-left-radius:@border_radius@px;
    border-top-right-radius:0px;
    border-bottom-right-radius:@border_radius@px;
    border-bottom-left-radius:0px;
}
*[border_radius="#0110"]{
    border-top-left-radius:0px;
    border-top-right-radius:@border_radius@px;
    border-bottom-right-radius:@border_radius@px;
    border-bottom-left-radius:0px;
}
*[border_radius="#0101"]{
    border-top-left-radius:0px;
    border-top-right-radius:@border_radius@px;
    border-bottom-right-radius:0px;
    border-bottom-left-radius:@border_radius@px;
}

*[border_radius="#1000"]{
    border-top-left-radius:@border_radius@px;
    border-top-right-radius:0px;
    border-bottom-right-radius:0px;
    border-bottom-left-radius:0px;
    
}
*[border_radius="#0100"]{
    border-top-left-radius:0px;
    border-top-right-radius:@border_radius@px;
    border-bottom-right-radius:0px;
    border-bottom-left-radius:0px;
    
}
*[border_radius="#0010"]{
    border-top-left-radius:0px;
    border-top-right-radius:0px;
    border-bottom-right-radius:@border_radius@px;
    border-bottom-left-radius:0px;
    
}
*[border_radius="#0001"]{
    border-top-left-radius:0px;
    border-top-right-radius:0px;
    border-bottom-right-radius:0px;
    border-bottom-left-radius:@border_radius@px;
    
}
*[border_radius="#0000"]{
    border-top-left-radius:0px;
    border-top-right-radius:0px;
    border-bottom-right-radius:0px;
    border-bottom-left-radius:0px;
}
/****************** border-color ********************/
*[border_color="01"]{
    border-color:@border_color_01@;
}
*[border_color="02"]{
    border-color:@border_color_02@;
}
*[border_color="03"]{
    border-color:@border_color_03@;
}
*[border_color="04"]{
    border-color:@border_color_04@;
}
*[border_color="05"]{
    border-color:@border_color_05@;
}
*[border_color="06"]{
    border-color:@border_color_06@;
}
*[border_color="07"]{
    border-color:@border_color_07@;
}
*[border_color="08"]{
    border-color:@border_color_08@;
}
*[border_color="09"]{
    border-color:@border_color_09@;
}
*[border_color="10"]{
    border-color:@border_color_10@;
}
*[content="true"]{
    background-color:@content_bg_color@;
}



*[item_status="normal"]{
    background-color:@item_bg_color@;
}
*[item_status="hover"]{
    background-color:@item_hover_bg_color@;
}
*[item_status="selected"]{
    background-color:@item_selected_bg_color@;
}
*[is_item="true"]{
    background-color:@item_bg_color@;
}
*[is_item="true"]::hover{
    background-color:@item_hover_bg_color@;
}
*[item="#"]{
    background-color:@item01_bg_color@;
}
*[item="#"]::hover{
    background-color:@item01_hover_bg_color@;
}
*[item="##"]{
    background-color:@item02_bg_color@;
}
*[item="##"]::hover{
    background-color:@item02_hover_bg_color@;
}
*[item="###"]{
    background-color:@item03_bg_color@;
}
*[item="###"]::hover{
    background-color:@item03_hover_bg_color@;
}


*[navigation_bar="true"]{
    background-color:@navigation_bar_bg_color@;
}
*[navigation_radio_btn="true"]{
    background-color:@navigation_radio_btn_bg_color@;
    color:@navigation_radio_btn_text_color@;
}
*[navigation_radio_btn="true"]::indicator::hover,
*[navigation_radio_btn="true"]::indicator::checked,
*[navigation_radio_btn="true"]::indicator::unchecked,
*[navigation_radio_btn="true"]::indicator::disabled,
*[navigation_radio_btn="true"]::indicator{
    image: none;
}

*[navigation_radio_btn="true"][status='checked']::hover,
*[navigation_radio_btn="true"][status='checked']{
    background-color:@navigation_radio_btn_checked_bg_color@;
    color:@navigation_radio_btn_checked_text_color@;
}
*[navigation_radio_btn="true"][status='unchecked']::hover,
*[navigation_radio_btn="true"][status='normal']::hover{
    background-color:@navigation_radio_btn_hover_bg_color@;
    color:@navigation_radio_btn_hover_text_color@;
}
*[navigation_radio_btn="true"][status='unchecked']{
    background-color:@navigation_radio_btn_unchecked_bg_color@;
    color:@navigation_radio_btn_unchecked_text_color@;
}


/****************** Slider ********************/
QSlider{
    background-color:rgba(255,255,255,0);
    image:url(:/smart/arrow_block_down_normal.png);
    }
QSlider::handle:horizontal{
    background-color:rgb(0,120,215);
    width:5px;
    margin: -5px 0px -5px 0px;
    border-radius:2px;
    }
QSlider::handle:horizontal:hover{
    background-color:rgba(255,255,255,255);
    }
QSlider::groove:horizontal{
    background-color:rgba(255,255,255,0);
    position: absolute;
    height: 2px;
    left: 5px;
    right: 5px;
    }
QSlider::add-page:horizontal{
    background:rgba(255,255,255,20)
    }
QSlider::sub-page:horizontal{
    background:rgba(0, 120, 215, 250);
    }

/****************** list view/widget ********************/

QListView,
QListWidget{
    background-color:@ListView@;
    border:none;
    }
QTreeView::indicator::partiallychecked,
QTreeWidget::indicator::partiallychecked,
QListView::indicator::partiallychecked,
QListWidget::indicator::partiallychecked{
    image:url(@ListView_indicator_partially_checked@);
}

QTreeView::indicator::unchecked,
QTreeWidget::indicator::unchecked,
QListView::indicator::unchecked,
QListWidget::indicator::unchecked{
    image:url(@ListView_indicator@);
}
QTreeView::indicator::checked,
QTreeWidget::indicator::checked,
QListView::indicator::checked,
QListWidget::indicator::checked{
    image:url(@ListView_indicator_checked@);
}


QListView::item,
QListWidget::item{
    background:@ListView_item@;
}
QListView::item::hover
QListWidget::item::hover{
    background:@ListView_item_hover@;
    }
QListView::item::selected::active,
QListWidget::item::selected::active{
    background:@ListView_item_selected@;
}
QListWidget::item::selected::!active{
    color:@disabled_color@;
    }


/****************** tree view/widget ********************/
QTreeView,
QTreeWidget{
    background-color:@TreeView@;
    border:none;
}
QTreeView:disabled,
QTreeWidget:disabled,
QListView:disabled, 
QListWidget:disabled{
    color:@disabled_color@;
}

QTreeWidget,
QTreeView{
    show-decoration-selected: 1;
    /*selection-background-color:rgb(0, 120, 215);
    border-top-width:1 solid rgb(20,20,20);
    border-bottom-width:1 solid rgb(20,20,20);
    alternate-background-color:rgb(40, 40, 40);
    border:1px solid rgb(44,45,49);
    */
    
    }

QTreeWidget::item,
QTreeWidget::item:has-children,
QTreeView::item:has-children,
QTreeView::item{
    height:@TreeView_item_height@px;
    }
QTreeWidget::branch,
QTreeWidget::item,
QTreeView::branch,
QTreeView::item{
    background:@TreeView@;
}
QTreeWidget::branch:hover,
QTreeWidget::branch:has-children:hover,
QTreeView::branch:hover,
QTreeView::branch:has-children:hover,
QTreeWidget::item:hover,
QTreeWidget::item:has-children:hover,
QTreeView::item:hover,
QTreeView::item:has-children:hover{
    background:@TreeView_item_hover@;
}
QTreeWidget::branch:selected,
QTreeWidget::branch:has-children:selected,
QTreeView::branch:selected,
QTreeView::branch:has-children:selected,
QTreeWidget::item:selected,
QTreeWidget::item:has-children:selected,
QTreeView::item:selected,
QTreeView::item:has-children:selected{
    background:@TreeView_item_selected@;
    }

QTreeWidget::branch:closed:has-children:!has-siblings,
QTreeWidget::branch:closed:has-children:has-siblings,
QTreeView::branch:closed:has-children:!has-siblings,
QTreeView::branch:closed:has-children:has-siblings{
    image:url(@TreeView_branch_close@);
    }
QTreeWidget::branch:open:has-children:!has-siblings,
QTreeWidget::branch:open:has-children:has-siblings,
QTreeView::branch:open:has-children:!has-siblings,
QTreeView::branch:open:has-children:has-siblings{
     image:url(@TreeView_branch_open@);
    }
QTreeWidget::branch:closed:has-children:!has-siblings:disabled,
QTreeWidget::branch:closed:has-children:has-siblings:disabled,
QTreeView::branch:closed:has-children:!has-siblings:disabled,
QTreeView::branch:closed:has-children:has-siblings:disabled{
    image:url(@TreeView_branch_close_disabled@);
    }
QTreeWidget::branch:open:has-children:!has-siblings:disabled,
QTreeWidget::branch:open:has-children:has-siblings:disabled,
QTreeView::branch:open:has-children:!has-siblings:disabled,
QTreeView::branch:open:has-children:has-siblings:disabled{
     image:url(@TreeView_branch_open_disabled@);
    }

"""
